

   Ext.grid.CheckColumn = function(config){
   			this.addEvents({
					click: true
				});
        Ext.apply(this, config);
        if(!this.id){
            this.id = Ext.id();
        }
        this.renderer = this.renderer.createDelegate(this);
		
//		this.count = 
		Ext.grid.CheckColumn.superclass.constructor.call(this,config);

    };

	Ext.extend(Ext.grid.CheckColumn, Ext.util.Observable,{
		
		init : function(grid){
            	this.record = [];
				this.grid = grid;
            	this.grid.on('render', function(){
                var view = this.grid.getView();
                view.mainBody.on('mousedown', this.onMouseDown, this);
            }, this);
		
			this.addEvents('cellclick');
        }
		
	,	onMouseDown: function(e, t){
		//if (this.readonly == false) {
			if (t.className && t.className.indexOf('x-grid3-cc-' + this.id) != -1) {
				e.stopEvent();
				var index = this.grid.getView().findRowIndex(t);
				var record = this.grid.store.getAt(index);
				var rowData = record
				record.set(this.dataIndex, !record.data[this.dataIndex]);
				}
			this.fireEvent('cellclick', e, index, t.className.indexOf('x-grid3-cc-' + this.id),record,this);
		//}
	}
	,	renderer : function(v, p, record){
            p.css += ' x-grid3-check-col-td'; 
            return '<div class="x-grid3-check-col'+(v?'-on':'')+' x-grid3-cc-'+this.id+'">&#160;</div>';
        }
		
	});
	
